import { useEffect, useState } from "react";

export const useMount = (fn: Function) => {
    const [ temp ] = useState({
        mounted: false
    })
    useEffect(() => {
        if(!temp.mounted) {
            temp.mounted = true;
            typeof fn === "function" && fn();
        }
    }, []);
};